<template>
  <div>
    <button @click="getStudentsInfo">点击请求学生信息</button>
    <button @click="getCarsInfo">点击请求汽车信息</button>
  </div>
</template>

<script>
import axios from 'axios';
export default {
  name: 'App',
  methods:{
    async getStudentsInfo(){
      const res =  await axios({
        // url:'http://127.0.0.1:8080/api/students',
        url:'/api/students',//可以直接简写
        method:'get'
      })
      console.log(res);
    },
    async getCarsInfo(){
     const res =  await axios({
        url:'/cars/cars',
        method:'get'
      })
      console.log(res);
    },
  }
}
</script>

<style scoped>

</style>
